←Select platform

CompareText(IList<string>) Method

Summary

Compares two strings

Syntax
C#
VB
C++
public IList<TextDifference> CompareText( 
   IList<string> texts 
) 
Public Function CompareText( 
   ByVal texts As IList(Of String) 
) As IList(Of TextDifference) 
public:  
   IList<TextDifference^>^ CompareText( 
      IList<String^>^ texts 
   ) 

Parameters

texts

List of strings to compare.

Return Value

A list of TextDifferences.

Remarks

Exactly two strings must be provided to this method.

Example
C#
using Leadtools.Document; 
using Leadtools.Document.Compare; 
using Leadtools; 
 
public void CompareTextStringExample() 
{ 
   var stringList = new List<string>() 
   { 
      "Hello World", 
      "Goodbye World" 
   }; 
 
   var comparer = new DocumentComparer(); 
   var diffs = comparer.CompareText(stringList); 
 
   foreach(TextDifference diff in diffs) 
   { 
      Console.WriteLine($"Operations: {diff.Operation}"); 
      Console.WriteLine($"Text: {diff.Text}"); 
      Console.WriteLine("--------"); 
   } 
} 

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Compare Assembly